﻿@{
    Layout = null;
}
@model Freshbox2._0.MODEL.manager

<!DOCTYPE html>

<html>
<head>
    <link rel="shortcut icon" href="favicon.ico">
    <link rel="icon" type="image/gif" href="~/img/animated_favicon1.gif">
    <meta name="viewport" content="width=device-width" />
    <link href="~/UILibs/easyui/themes/default/easyui.css" rel="stylesheet" />
    <link href="~/UILibs/easyui/themes/icon.css" rel="stylesheet" />
    <link href="~/Css/css.css" rel="stylesheet" />

    <script src="~/Scripts/jquery-1.7.1.min.js"></script>
    <script src="~/UILibs/easyui/jquery.easyui.min.js"></script>
    <script src="~/UILibs/easyui/locale/easyui-lang-zh_CN.js"></script>

    <script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
    <script src="~/Scripts/jquery.validate.min.js"></script>
    <script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>
    <script src="~/Scripts/datagrid-detailview.js"></script>
    <title></title>
        <style type="text/css">
        .subtotal {
            font-weight: bold;
            color: black;
            /*//background-color: dodgerblue;*/
            height: 200px;
            width: 200px;
            font-size: 20px;
        }

        .subtotal2 {
            font-weight: bold;
            color: black;
            width: 10%;
            margin-top: 10px;
            background-color: orange;
            font-size: 20px;
        }
        /*合计单元格样式*/
    </style>
    <script type="text/javascript">
        $(function () {
            //动态加载  店铺列表
            $("#managerCode").combobox({
                url: pageConfig.getManagerName,
                //action 
                valueField: "managerCode",
                textField: "managerName"
            });
        });

    </script>
    <script type="text/javascript">


        $(function () {
            $("#data").datagrid({
                fit: true,
                title: '理货员配送记录',
                striped: true,
                rownumbers: true,
                columns:
                    [[
                    {//   //RealName  managerCode  storeName   rpsmovertime rpsmId  allPrice
                        field: 'rpsmId',
                        title: '补货单编号',
                        width: 150,
                        height: 50,
                        halign: 'center',
                        sortable: true,
                        align: 'center'
                    }, {
                        field: 'managerCode',
                        title: '理货员编号',
                        width: 150,
                        height: 50,
                        halign: 'center',
                        align: 'center',
                    }, {
                        field: 'RealName',
                        title: '理货员姓名',
                        width: 150,
                        height: 50,
                        halign: 'center',
                        align: 'center'
                    }, {
                        field: 'storeName',
                        title: '店铺名称',
                        width: 300,
                        height: 50,
                        halign: 'center',
                        align: 'center'
                    }, {
                        field: 'rpsmovertime',
                        title: '完成时间',
                        width: 200,
                        height: 50,
                        halign: 'center',
                        align: 'center'
                    }, {
                        field: 'allPrice',
                        title: '总价值',
                        width: 150,
                        height: 50,
                        halign: 'center',
                        align: 'center'
                    }]],
                url: pageConfig.getAction,
                onLoadSuccess: compute,//加载完毕后执行计算
                //pagination: true,
                //pageSize: 10,
                //pageList: [10, 15, 20, 25],
                //sortName: 'userid',
                //sortOrder: 'desc',
                toolbar: '#tool'
            });

        });

        function compute() {//计算函数
            //alert(111);
            var rows = $('#data').datagrid('getRows');//获取当前的数据行
            var total = 0;//计算listprice的总和
            for (var i = 0; i < rows.length; i++) {
                total += parseFloat(rows[i]['allPrice']);

            }
            //alert(total.toFixed(2));
            $("#txtAllMoney").val(total.toFixed(2) + "元");
        }


        var pageConfig = {
            getManagerName: '@Url.Action("GetManagerName")',
            getAction: '@Url.Action("Get2")',
        };


        function searchData() {
            $("#data").datagrid('load', {
          
            date1: $('#txtDate1').val(),
            date2: $('#txtDate2').val(),
            managerCode: $("#managerCode").combobox('getValue'),
            });
        }

    </script>
</head>
<body class="easyui-layout" style="width: 100%; height: 100%">
    <div data-options="region:'center'">
        <table id="data"></table>
        <div id="tool" style="padding: 10px;">
            <div style="margin-bottom: 10px;">
                <div style="margin-bottom: 10px;">
                    &nbsp&nbsp&nbsp &nbsp&nbsp&nbsp &nbsp&nbsp&nbsp &nbsp&nbsp&nbsp 
                理货员名称：
                 <input id="managerCode" class="easyui-combobox" name="managerCode" />
                    &nbsp&nbsp&nbsp &nbsp&nbsp&nbsp 
               日期：<input id="txtDate1" type="text" class="easyui-datebox" />
                    -- 
                <input id="txtDate2" type="text" class="easyui-datebox" />&nbsp&nbsp &nbsp&nbsp&nbsp
                    <a class="easyui-linkbutton" iconcls="icon-search" onclick="searchData()">查询</a>
                    <span style="font-size: larger; color: red">&nbsp&nbsp &nbsp&nbsp&nbsp   &nbsp&nbsp&nbsp &nbsp&nbsp&nbsp  </span>
                    <div style="margin-top: 20px;">
                        <span style="font-size: larger; color: red">&nbsp&nbsp &nbsp&nbsp&nbsp   &nbsp&nbsp&nbsp &nbsp&nbsp&nbsp   注意:默认显示为本月1号至今日的补货订单</span>
                   
                        &nbsp&nbsp&nbsp   &nbsp&nbsp&nbsp  &nbsp&nbsp&nbsp<span class="subtotal" style="">补货单价值为：</span>
                        <input id="txtAllMoney" type="text" class="subtotal2" />
                    </div>

                </div>
            </div>
        </div>
    </div>



</body>
</html>
